#ifndef _Z3D_CORE_RTTI_H_
#define _Z3D_CORE_RTTI_H_

#include "../internal/cuCoreLib.h"

namespace z3d
{
class Rtti
{
public:

    Rtti (const char* name, const Rtti* baseType);
    ~Rtti ();

    inline const char* GetName () const;
    inline bool IsExactly (const Rtti& type) const;
    bool IsDerived (const Rtti& type) const;

private:
    const char* m_name;
    const Rtti* m_baseType;
};

#include "rttiSystem.inl"

}

//----------------------------------------------------------------------------
#define RTTI_DECLARATION \
public: \
    static const Rtti TYPE; \
    \
    virtual const Rtti& GetRttiType () const \
    { \
        return TYPE; \
    }
//----------------------------------------------------------------------------
#define RTTI_IMPLEMENTATION(nsname, baseclassname, classname) \
    const Rtti classname::TYPE(#nsname"."#classname, &baseclassname::TYPE)
//----------------------------------------------------------------------------

#endif
